﻿@model DataEntity.OffGoods




<div class="div_center">

    @using (Html.BeginForm("", "", FormMethod.Post, new { id = "goodsfm", name = "goodsfm" }))
    { 
        <fieldset class="datebox-button" style="height: auto; text-align: left; padding-top: 8px; padding-right: 8px; padding-bottom: 8px; padding-left: 8px;">
            <legend class="panel-title">物品信息</legend>


           <table class="TableBlock">
           
            <tr>
             
                <td  class="TableLabel" >
                    @Html.HiddenFor(model=>model.ID)
                    @Html.HiddenFor(model=>model.OffGoodsClassID)
                    物品名称:
                </td>
                <td class="TableData" >
                    
                        @Html.TextBoxFor(model => model.Name)
                       
                </td>
               <td  class="TableLabel">
                   物品编号:
                </td>
                <td class="TableData" >
                   
                         @Html.TextBoxFor(model => model.Code)
                       
                </td>
            </tr>
             <tr>
                <td class="TableLabel" >
                  库存数量:
                </td>
                <td class="TableData" >
                         @Html.TextBoxFor(model => model.Inventory, new { style="width:100px"})
                </td>
                <td  class="TableLabel">
                排序号:
                </td>
                <td class="TableData">
                      @Html.TextBoxFor(model => model.SortNumber, new { style="width:100px"})
                     
                </td>
            </tr>
            <tr>
                <td class="TableLabel" >
                  税后单价:
                </td>
                <td class="TableData" >
                         @Html.TextBoxFor(model => model.AverageAfterTaxPrice, new { style="width:100px"})
                </td>
                <td  class="TableLabel">
                  计量单位:
                </td>
                <td class="TableData">
                      @Html.TextBoxFor(model => model.Unit, new { style="width:100px"})
                     
                </td>
            </tr>
                <tr>
                <td  class="TableLabel">
                    描述:
                </td>
                <td class="TableData" colspan="3">
                    
                        @Html.TextAreaFor(model => model.Des, new { cols = "3", rows = "4", style = "height:70px;width: 93%; text-align: left;" })
                       
                </td>
            </tr>
            <tr>
                <td  class="TableLabel">
                    备注:
                </td>
                <td class="TableData" colspan="3">
                    
                        @Html.TextAreaFor(model => model.Remark, new { cols = "3", rows = "4", style = "height:70px;width: 93%; text-align: left;" })
                       
                </td>
            </tr>
        </table>

        </fieldset>
    }

</div>


<script>
    $(function () {
        var _form = $("#goodsfm");
        var _key = $("#ID", $("#goodsfm")).val();
      
        if (_key == "0") {
            $("#Name", _form).validatebox({ required: true });
            
        }
        else {
            $("#Name", _form).attr("readonly", "readonly");
            $("#Name", _form).addClass("BigStatic");

        }
        $("#Inventory", _form).attr("readonly", "readonly");
        $("#Inventory", _form).addClass("BigStatic");
        $("#AverageAfterTaxPrice", _form).attr("readonly", "readonly");
        $("#AverageAfterTaxPrice", _form).addClass("BigStatic");
     
        $("#SortNumber", _form).validatebox({ required: true, validType: ['integer'] });
        $("#Unit", _form).validatebox({ required: true });
    });
  

</script>
